﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UFSoft.UBF.Util.DataAccess;

namespace UFIDA.U9.YD.Cli.PlugUI.YD
{
    internal class YDUtils
    {
        /// <summary>
        /// 获取U9参数
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        public static string GetParam(string code)
        {
            //DataAccessor可以在UI端调用

            object val;
            string sql=$@"select val.[Value]
                    from Base_Profile doc
                    join Base_Profile_Trl doc1 on doc1.ID=doc.ID and doc1.SysMLFlag='zh-CN'
                    left join Base_ProfileValue val on val.Profile=doc.ID
                    where doc.Code='{code}'";
            DataAccessor.RunSQL(DataAccessor.GetConn(), sql, null, out val);

            if (val == null) return "";
            else return val.ToString();
        }
    }
}
